﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace EzDesk.DevHelper.EzMLGenerator
{
    public class LanguageUserInfoProcessor : EzMLProcessor
    {
        //public override string[] RegexStrs
        //{
        //    get { return new string[] { "<ez:target><ez:text>{(?<name>.*?)Name}</ez:text></ez:target>" }; }
        //}

        //public override string[] ReplaceStrs
        //{
        //    get { 
        //        return new string[] 
        //            { 
        //                @"${name}"
        //            };
        //    }
        //}

        public override string Process(string input)
        {
            string regexPattern = "<ez:target><ez:text>{(?<name>.*?)Name}</ez:text></ez:target>";
            var output = input;

            output = Regex.Replace(output, regexPattern, "||${name}||");
            output = output.Replace("||", "$");
            return output;
        }
    }
}
